{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0ca29a5b-0872-4fd7-b6f2-abf02df821a2",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install tensorflow\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5ce0cc77-7677-4647-ac76-b0d88f839d61",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "ciraf10=tf.keras.datasets.cifar10\n",
    "(x_train,y_trian),(x_test,y_test)=cifar10.load_data()\n",
    "x_train,x_test=tf.cast(x_train,dtype=tf.float32)/255.0,tf.cast(x_test,dtype=tf.float32)/255.0\n",
    "y_train,y_test=tf.cast(y_train,dtype=tf.int32),tf.cast(y_test,dtype=tf.int32)\n",
    "print(\"x_train.shape=\",x_train.shape)\n",
    "print(\"y_train.shape=\",y_train.shape)\n",
    "print(\"x_test.shape=\",x_test.shape)\n",
    "print(\"y_test.shape=\",y_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f7ff3d4-5390-4e02-a99a-eb5d840371a8",
   "metadata": {},
   "outputs": [],
   "source": [
    "model=tf.keras.models.Sequential([\n",
    "tf.keras.layers.Conv2D(32,kernel_size=(3,3),padding=\"SAME\",activation=tf.nn.relu,input_shape=x_train.shape[1:]),\n",
    "tf.keras.layers.Maxpool2D(pool_size)=(2,2),strides=(1,1),padding=\"SAME\"\n",
    "tf.keras.layers.Dropout(0.2),\n",
    "tf.keras.layers.Con2D(64,kernel_size=(3,3),padding=\"SAME\",activation=tf.nn.relu),\n",
    "tf.keras.layers.Maxpool2D(pool_size=(2,2),strides=(1,1),padding=\"SAME\")\n",
    "tf.keras.layers.Dropout(0.2),\n",
    "tf.keras.layers.Flatten(),\n",
    "tf.keras.layers.Dense(512,activation='relu'),\n",
    "tf.keras.layers.Dropout(0.2),\n",
    "tf.keras.layers.Dense(256,activation='relu'),\n",
    "tf.keras.layers.Dropout(0.5),\n",
    "tf.keras.layers.Dense(10,activation='softmax'),])\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f709081-9f90-49a0-9c07-023868ddcef1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
